cmake_minimum_required(VERSION 3.16)
project(RLIB C)
##--- ---##
set(TARGET_ rlib)
set(LINK_
        collection
        cpp
        )
##--- ---##
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_BUILD_TYPE "Release")
##--- ---##
set(CMAKE_C_FLAGS "-lpthread")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

message("##--- start build ---##")

aux_source_directory(. SRC_LIST)
add_subdirectory(src)
link_directories(lib dependence)
include_directories(include dependence)
set(EXTRA_LIBS ${EXTRA_LIBS} ${LINK_})

add_executable(${TARGET_} ${SRC_LIST})

target_link_libraries(${TARGET_} ${EXTRA_LIBS})
